#!/usr/bin/env bash

while true
do
    if [ $(netstat  -a -n |grep '0.0.0.0:4000' |grep 'LISTENING'|wc -l) -eq 1 ]
    then
        book >& /dev/null
    fi
    sleep 1
done

